package com.tnf.bc.bground.common.exception;

import com.tnf.bc.bground.common.utils.resultutil.ApiResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @description: //TODO
 * @author: lzl
 * @create: 2022-11-24 22:08
 **/

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(BookSysException.class)
    @ResponseBody
    public ApiResponse bookSysExceptionHlander(BookSysException e) {
        return new ApiResponse(e.getCode(),e.getMessage());
    }
}